import React, {
    PureComponent
} from 'react';

import WebView from './index';

import * as Env from './../../env';

interface State {
    url: string
}

class Privacy extends PureComponent<any, State> {
    state = {
        url: ``
    }

    async url() {
        return await Env.apiBaseUrl() + `/home/privacy`;
    }

    async componentDidMount() {
        this.setState({
            url: await this.url()
        })
    }

    render() {
        const {
            url
        } = this.state;

        return (
            <WebView uri={url} title="Privacy Policy"/>
        )
    }
}

export default Privacy;